<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
/*
 * 回调函数的this绑定丢失问题: this会绑定到window
 *
 * 显示绑定的丢失问题:
 *  显示把绑定到undefined和null上面的时候, 会使用默认绑定
 *
 *
 *
 */

var obj = {
    name : "李四",
    foo : function (){
        console.log(this);
    }
}

obj.foo.call(undefined);


/*var name = "zs"
var obj = {
    name : "李四",
   /!* show : function (){
        var self = this;
        setInterval(function (){
            console.log(self.name);
        }, 1000)
    }*!/
    show : function (){
        setInterval(function (){
            console.log(this.name);
        }.bind(this), 1000)
    }
}
obj.show();*/
</script>
</body>
</html>